3.326 \(\int (a+b \sec ^2(e+f x))^2 \tan (e+f x) \, dx\)

Optimal. Leaf size=48 \[ -\frac{a^2 \log (\cos (e+f x))}{f}+\frac{a b \sec ^2(e+f x)}{f}+\frac{b^2 \sec ^4(e+f x)}{4 f} \]

[Out]

-((a^2*Log[Cos[e + f*x]])/f) + (a*b*Sec[e + f*x]^2)/f + (b^2*Sec[e + f*x]^4)/(4*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0419613, antiderivative size = 48, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4138, 266, 43} \[ -\frac{a^2 \log (\cos (e+f x))}{f}+\frac{a b \sec ^2(e+f x)}{f}+\frac{b^2 \sec ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^2)^2*Tan[e + f*x],x]

[Out]

-((a^2*Log[Cos[e + f*x]])/f) + (a*b*Sec[e + f*x]^2)/f + (b^2*Sec[e + f*x]^4)/(4*f)

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \left (a+b \sec ^2(e+f x)\right )^2 \tan (e+f x) \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{\left (b+a x^2\right )^2}{x^5} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{(b+a x)^2}{x^3} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (\frac{b^2}{x^3}+\frac{2 a b}{x^2}+\frac{a^2}{x}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{a^2 \log (\cos (e+f x))}{f}+\frac{a b \sec ^2(e+f x)}{f}+\frac{b^2 \sec ^4(e+f x)}{4 f}\\ \end{align*}

Mathematica [A]  time = 0.122499, size = 82, normalized size = 1.71 \[ -\frac{\sec ^4(e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (4 a^2 \cos ^4(e+f x) \log (\cos (e+f x))-4 a b \cos ^2(e+f x)-b^2\right )}{f (a \cos (2 (e+f x))+a+2 b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^2)^2*Tan[e + f*x],x]

[Out]

-(((b + a*Cos[e + f*x]^2)^2*(-b^2 - 4*a*b*Cos[e + f*x]^2 + 4*a^2*Cos[e + f*x]^4*Log[Cos[e + f*x]])*Sec[e + f*x
]^4)/(f*(a + 2*b + a*Cos[2*(e + f*x)])^2))

________________________________________________________________________________________

Maple [A]  time = 0.022, size = 46, normalized size = 1. \begin{align*}{\frac{{b}^{2} \left ( \sec \left ( fx+e \right ) \right ) ^{4}}{4\,f}}+{\frac{ab \left ( \sec \left ( fx+e \right ) \right ) ^{2}}{f}}+{\frac{{a}^{2}\ln \left ( \sec \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^2)^2*tan(f*x+e),x)

[Out]

1/4*b^2*sec(f*x+e)^4/f+a*b*sec(f*x+e)^2/f+1/f*a^2*ln(sec(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 0.981485, size = 90, normalized size = 1.88 \begin{align*} -\frac{2 \, a^{2} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) + \frac{4 \, a b \sin \left (f x + e\right )^{2} - 4 \, a b - b^{2}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*tan(f*x+e),x, algorithm="maxima")

[Out]

-1/4*(2*a^2*log(sin(f*x + e)^2 - 1) + (4*a*b*sin(f*x + e)^2 - 4*a*b - b^2)/(sin(f*x + e)^4 - 2*sin(f*x + e)^2
+ 1))/f

________________________________________________________________________________________

Fricas [A]  time = 0.530731, size = 130, normalized size = 2.71 \begin{align*} -\frac{4 \, a^{2} \cos \left (f x + e\right )^{4} \log \left (-\cos \left (f x + e\right )\right ) - 4 \, a b \cos \left (f x + e\right )^{2} - b^{2}}{4 \, f \cos \left (f x + e\right )^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*tan(f*x+e),x, algorithm="fricas")

[Out]

-1/4*(4*a^2*cos(f*x + e)^4*log(-cos(f*x + e)) - 4*a*b*cos(f*x + e)^2 - b^2)/(f*cos(f*x + e)^4)

________________________________________________________________________________________

Sympy [A]  time = 2.19811, size = 61, normalized size = 1.27 \begin{align*} \begin{cases} \frac{a^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{a b \sec ^{2}{\left (e + f x \right )}}{f} + \frac{b^{2} \sec ^{4}{\left (e + f x \right )}}{4 f} & \text{for}\: f \neq 0 \\x \left (a + b \sec ^{2}{\left (e \right )}\right )^{2} \tan{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**2)**2*tan(f*x+e),x)

[Out]

Piecewise((a**2*log(tan(e + f*x)**2 + 1)/(2*f) + a*b*sec(e + f*x)**2/f + b**2*sec(e + f*x)**4/(4*f), Ne(f, 0))
, (x*(a + b*sec(e)**2)**2*tan(e), True))

________________________________________________________________________________________

Giac [B]  time = 1.36989, size = 486, normalized size = 10.12 \begin{align*} \frac{2 \, a^{2} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right ) - 2 \, a^{2} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2\right ) + \frac{3 \, a^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}^{2} + 12 \, a^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 16 \, a b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 8 \, b^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 12 \, a^{2} - 32 \, a b}{{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right )}^{2}}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*tan(f*x+e),x, algorithm="giac")

[Out]

1/4*(2*a^2*log(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2) - 2*a^2*log
(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2) + (3*a^2*((cos(f*x + e) +
 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1))^2 + 12*a^2*((cos(f*x + e) + 1)/(cos(f*x + e) -
 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) - 16*a*b*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) -
 1)/(cos(f*x + e) + 1)) - 8*b^2*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)
) + 12*a^2 - 32*a*b)/((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2)^2)/f